﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AddressLookup.ascx.cs"
            Inherits="AB.ServiceDirectory.Design.WebUserControls.Lookup.AddressLookup" %>
<%@ Register TagPrefix="cc1" Namespace="Vladsm.Web.UI.WebControls" Assembly="GroupRadioButton, Version=1.0.0.0, Culture=neutral, PublicKeyToken=93985c16c9bea92d" %>
<asp:Panel runat="server" ID="PanelContainer" CssClass="" Visible="false">
    <%--<asp:UpdatePanel ID="ContactListUpdatePanel" runat="server">
        <ContentTemplate>--%>
    <div class="grid740 simplebox popup">
        <div class="titleh">
            <h3>Search Business Type</h3>
        </div>
        <div class="body">
            <div class="st-form-line">
                <div class="half level2">
                    <asp:Label ID="LabelPostcode" runat="server" Text="Postcode" AssociatedControlID="TextBoxPostcode"></asp:Label>
                    <asp:TextBox ID="TextBoxPostcode" runat="server" CssClass="st-forminput" 
                                 Width="100px"></asp:TextBox>
                </div>
                <div class="half level2-5">
                    <asp:Label ID="LabelBoxStreet" runat="server" Text="Street" AssociatedControlID="TextBoxStreet"></asp:Label>
                    <asp:TextBox ID="TextBoxStreet" runat="server" CssClass="st-forminput" 
                                 Width="200px"></asp:TextBox>
                </div>
                <div class="half level2">
                    <asp:Label ID="LabelBoxTown" runat="server" Text="Town"></asp:Label>
                    <asp:TextBox ID="TextBoxTown" runat="server" CssClass="st-forminput" 
                                 Width="100px"></asp:TextBox>
                </div>
                <div class="clear">
                </div>
            </div>
            <div class="button-box">
                <asp:Button ID="ButtonSearch" runat="server" Text="Search Address" CssClass="st-button"
                            OnClick="ButtonSearchClick" />
                <asp:Button ID="ButtonNone" runat="server" Text="None" CssClass="st-button" OnClick="ButtonNoneClick" />
                <asp:Button ID="ButtonClear" runat="server" Text="Clear" CssClass="st-button" OnClick="ButtonClearClick" />
            </div>
            <div class="st-form-line">
                <div class="titleh">
                </div>
                <asp:GridView ID="GridViewSearchPostcode" runat="server" CssClass="tablesorter" AutoGenerateColumns="False"
                              Width="754px" DataSourceID="AddressObjectDataSource" AllowPaging="true" AllowSorting="true"
                              DataKeyNames="AddressId">
                    <Columns>
                        <asp:TemplateField HeaderText="Select">
                            <ItemTemplate>
                                <cc1:GroupRadioButton ID="GroupRadioButton1" runat="server" GroupName="GroupSearch" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="Address" DataField="AddressLine" SortExpression="AddressLine">
                            <HeaderStyle HorizontalAlign="Left" CssClass="header" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Post Code" DataField="PostCode" SortExpression="Postcode">
                            <HeaderStyle HorizontalAlign="Left" CssClass="header" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Town" SortExpression="TownName">
                            <ItemTemplate>
                                <%#Eval("Town.TownName")%>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" CssClass="header" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="County" SortExpression="CountyName">
                            <ItemTemplate>
                                <%#Eval("Town.County.CountyName")%>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" CssClass="header" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Country" SortExpression="CountryName">
                            <ItemTemplate>
                                <%#Eval("Town.County.Country.CountryName")%>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" CssClass="header" />
                        </asp:TemplateField>
                    </Columns>
                    <PagerStyle CssClass="pagination_table" />
                </asp:GridView>

                <asp:ObjectDataSource ID="AddressObjectDataSource" runat="server" SelectMethod="GetList"
                                      TypeName="AB.ServiceDirectory.BO.AddressBO" EnablePaging="true" SelectCountMethod="GetListCount"
                                      StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maxRows"
                                      SortParameterName="sortType" OnSelecting="AddressObjectDataSourceSelecting">
                    <SelectParameters>
                        <asp:Parameter Name="filter" Type="Object" ConvertEmptyStringToNull="False" />
                    </SelectParameters>
                </asp:ObjectDataSource>

                <br />
                <div class="">
                    <asp:Button ID="ButtonSelect" runat="server" Text="Select" CssClass="st-button" OnClick="ButtonSelectClick" />
                    <asp:Button ID="ButtonClose" runat="server" Text="Close" CssClass="st-button" OnClick="ButtonCloseClick" />
                </div>
            </div>
        </div>
    </div>
    <%--</ContentTemplate>
    </asp:UpdatePanel>--%>
    <div class="clear">
    </div>
</asp:Panel>